﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
using System.Text;

/// <summary>
///PageBase 的摘要说明
/// </summary>
public class PageBase : System.Web.UI.Page
{

    public void Alert(string str)
    {
        Page.ClientScript.RegisterStartupScript(GetType(), "onload", "<script>alert(\"" + str + "\");</script>");
    }

    public void Alert(string str, string url)
    {
        if (url == "")
            Alert(str);
        else
            Page.ClientScript.RegisterStartupScript(GetType(), "onload", "<script>alert(\"" + str + "\");location.href='" + url + "';</script>");
    }

    public void AlertHtml(string html)
    {
        Page.ClientScript.RegisterStartupScript(GetType(), "onload", string.Format("<script>{0}</script>", html));
    }

    public void ERR()
    {
        Response.Redirect("/shcssmg/apps/error/index.aspx");
    }

    public void AlertRedirect(string str, string url)
    {
        Page.ClientScript.RegisterStartupScript(GetType(), "onload", "<script type=\"text/javascript\" language=\"javascript\">alert(\"" + str + "\");location.href='" + url + "';</script>");
    }
}